﻿using System;
using System.Collections.Generic;
using System.Web;
using WAD.WEB.AppCode;
using GL.Tools;
using WAD.Model;

namespace WAD.WEB.Admin.Ajax
{
    /// <summary>
    /// log 的摘要说明
    /// </summary>
    public class log : AdminAjax
    {
        public override void AjaxMethodDispatch(String identity)
        {
            switch (identity)
            {
                case "getlist": this.GetList(); break;
            }
        }
        [QD.Web.Ajax.AjaxMethod]
        public void GetList()
        {
            int page = Parse.Int("page", 1);
            int userid = Parse.Int("user_id", 0);
            string where = "";
            if (userid > 0)
                where = "user_id=" + userid;
            PageData pg = DAL.DAOLog.GetListPage("*,(select top 1 name from admin where admin.id=log.adminid) as name", "id desc", page, 20, where, "log");
            if (pg.itemCount < 1)
                DataEmpty();
            JsonResult(0, "", pg);
        }
    }
}